package com.leyou.item.api;

import com.leyou.item.pojo.SpecGroup;
import com.leyou.item.pojo.SpecParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@RequestMapping("spec")
public interface SpecificationApi {
    /**
     * 根据参数集合查询商品规格参数
     * @param gid
     * @param cid
     * @param searching
     * @return
     */
    @GetMapping("params")
    List<SpecParam> queryParamByList(
            @RequestParam(value = "gid",required = false) Long gid,
            @RequestParam(value = "cid",required = false) Long cid,
            @RequestParam(value = "searching",required = false) Boolean searching
    );

    /**
     * 根据分类查询规格组以及组内参数
     * @param cid
     * @return
     */
    @GetMapping("group")
    List<SpecGroup> queryListByCid(@RequestParam("cid") Long cid);


}
